﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using MINERP.MODEL.PrintManage;

namespace MINERP.Xray
{
    public partial class FrmPaperEnd : Form
    {

        public PaperInfoModel PaperInfo { get; set; }//打印纸
        public double PaperEndLength { get; set; }//输入的纸尾的长度,单位为m

        public FrmPaperEnd()
        {
            InitializeComponent();
        }

        private void FrmPaperEnd_Load(object sender, EventArgs e)
        {
            txtPaperEnd.Text = (PaperInfo.LastLength*100).ToString();
        }

        private void btnOk_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtPaperEnd.Text.Trim()))
            {
                MessageBox.Show("请输入纸尾长度", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                txtPaperEnd.Focus();
                return;
            }
            if (Convert.ToDouble(txtPaperEnd.Text)<0)
            {
                MessageBox.Show("纸尾的长度不能为负数！请输入正确的纸尾长度!");
                return;
            }
            //((FrmChangePaper)(this.Owner)).PaperEnd = Convert.ToDouble(txtPaperEnd.Text) / 100;
            PaperEndLength = Convert.ToDouble(txtPaperEnd.Text) / 100;
            this.DialogResult = DialogResult.OK;
        }
    }
}
